import zerorpc
import sys
import os
#c = zerorpc.Client()
#c.connect("tcp://127.0.0.1:4242")

#for item in c.streaming_range(10, 20, 2):
#    print item

#print c.init_dataset()

#d = zerorpc.Client()
#d.connect("tcp://127.0.0.1:4243")
#print c.test_fold2()

#print c.create_tree('javaParameter0.txt')

#print 'new class'
#print d.predict_method('javaParameter0.txt','boolean')
treeNumber = sys.argv[1]
serialNumberString = sys.argv[2]
treeSentence = sys.argv[3]
e = zerorpc.Client()
e.connect("tcp://10.131.253.117:4242")
class_ans = e.prediction(treeNumber,serialNumberString,treeSentence)
print 'startrecord'
splits = class_ans.split('\n')
for item in splits:
    print item
#print class_ans

# f = zerorpc.Client()
# f.connect("tcp://127.0.0.1:4243")
# method_ans = f.prediction(treeNumber,serialNumberString,treeSentence,class_ans)
# print 'startrecord'
# splits = method_ans.split('\n')
# for item in splits:
#     print item
#os.remove('/home/inspur/IdeaProjects/CodeRecommendation/TreeLSTM/javaParameter/javaParameter0.txt')
